﻿Imports DTO
Imports System.Windows.Forms

Public Class PhieuNhapSachDAO
    Public Sub Them(ByVal pnDTO As PhieuNhapSachDTO)

        Try
            Dim db As New QuanLyNhaSachDataContext
            Dim pn As New PhieuNhapSach

            pn.NgayNhap = pnDTO.NgayNhap

            db.PhieuNhapSaches.InsertOnSubmit(pn)
            db.SubmitChanges()
            pnDTO.MaPN = pn.MaPN
        Catch ex As Exception
            MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error)
        End Try
        
    End Sub
End Class
